<?php
declare(strict_types=1);

namespace app\common\validate;

use think\Validate;

class CoursePart extends Validate
{
    protected $rule = [
        'name' => 'require',
        'c_id' => 'integer',
        'image'=>'require',
        'url' => 'require',
    ];

    protected $message = [
        'name.require' => '章节名称必须',
        'c_id.integer' => '课程必须',
        'image.require' => '章节图片必须',
        'url.url' => '播放地址必须',
    ];

    protected $scene = [
        'edit' => ['name', 'url','image'],
        'add' => ['name', 'c_id', 'url','image']
    ];
}
